<template>
  <div class="item">
    <span class="iconfont" :class="icon" :style="{ color: iconColor }"></span>
    <div class="item-moudel">
      <h2>{{ title }}</h2>
      <p>{{ price | toThousands }}</p>
    </div>
  </div>
</template>

<script>
export default {
  //接收父传来的数据
  // props:['title']
  props: {
    title: {
      type: String,
      default: "",
    },
    icon: {
      type: String,
      default: "",
    },
    iconColor: {
      type: String,
      default: "",
    },
    price: {
      type: [Number, String],
      default: "",
    },
  },
};
</script>

<style lang="less" scoped>
.item {
  width: 24%;
  background-color: #fff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 20px;
  margin-right: 10px;
  margin-bottom: 10px;
  flex: 1 1 200px;
  span {
    font-size: 50px;
  }
  .item-moudel {
    text-align: center;
    h2 {
      color: #ccc;
      font-weight: normal;
    }
    p {
      font-size: 20px;
      font-weight: bold;
    }
  }
}

@media screen and (max-width: 1100px) {
  .item {
    span {
      font-size: 40px;
    }
    h2 {
      font-size: 18px;
    }
    p {
      font-size: 16px;
    }
  }
}

@media screen and (min-width: 850px) and (max-width: 1080px) {
  .item {
    width: 350px;
    flex: 0;
  }
}
</style>